<!--
 * @Description  : 
 * @Version      : 1.0
 * @Author       : Shiming
 * @Date         : 2022-01-12 10:52:50
 * @LastEditors  : Shiming
 * @LastEditTime : 2022-04-11 14:33:19
 * @FilePath     : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\complaint\\complaint.component.html
 * Copyright (C) 2022 huzhenhong. All rights reserved.
-->

<!-- 搜索表单 -->
<!-- <page-header-wrapper title="" [tab]="tpTab">
  <ng-template #tpTab>
    <nz-tabset [nzSelectedIndex]="selectedIndex" [nzTabBarExtraContent]="extraTemplate">
      <nz-tab *ngFor="let tab of mainTabs" [nzTitle]="tab.name" (nzSelect)="selectMainTab(tab)">
      </nz-tab>
    </nz-tabset>
  </ng-template>
</page-header-wrapper> -->
<!-- <nz-card>
  <div nz-row nzGutter="12">
    <div nz-col [nzSpan]="24">
      <sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
    </div>
    <div nz-col [nzSpan]="24" style="display: flex; justify-content: flex-end;">
      <button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="isLoading && st.loading"
        (click)="st?.load(1)" acl [acl-ability]="['ORDER-COMPLAINT-search']">查询</button>
      <button nz-button nzType="primary" acl [acl-ability]="['ORDER-COMPLAINT-export']" (click)="exprot()">导出</button>
      <button nz-button (click)="resetSF()">重置</button>
    </div>
  </div>
</nz-card> -->

<nz-card class="table-box">
  <div class="tab_header">
    <label class="page_title"> <label class="driver">|</label> 投诉管理</label>
    <nz-tabset [nzSelectedIndex]="selectedIndex" [nzTabBarExtraContent]="extraTemplate">
      <nz-tab *ngFor="let tab of mainTabs" [nzTitle]="tab.name" (nzSelect)="selectMainTab(tab)">
      </nz-tab>
    </nz-tabset>
  </div>
  <nz-tabset (nzSelectedIndexChange)="selectChange($event)">
    <nz-tab *ngFor="let tab of tabs; let i = index" [nzTitle]="tab.name" (nzClick)="tabChange(i)">
    </nz-tab>
  </nz-tabset>
  <div>
    <st #st [bordered]="true" [scroll]="{ x: '2000px',y:scrollY  }" [data]="service.$api_get_operate_listPage"
      [columns]="columns"
      [req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
      [res]="{ reName: { list: 'data.records', total: 'data.total' } }"
      [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }" [loading]="false">
      <ng-template st-row="complaintCode" let-item let-index="index">
        <a href="javascript:;" (click)="view(item)">{{item.complaintCode}}</a>
      </ng-template>
      <ng-template st-row="complaintCauseLabel" let-item let-index="index">
        <div *ngIf="selectedMainTabStatus == '2'">{{item?.drvComplaintCauseLabel}}</div>
        <div *ngIf="selectedMainTabStatus == '1'">{{item?.complaintCauseLabel}}</div>
      </ng-template>
    </st>
  </div>
</nz-card>

<ng-template #extraTemplate>
  <div class="mr-sm">
    <button nz-button nzDanger [nzLoading]="isLoading && st.loading" (click)="openDrawer()" acl
      [acl-ability]="['ORDER-COMPLAINT-search']">筛选</button>
    <button nz-button nzDanger acl [acl-ability]="['ORDER-COMPLAINT-export']" (click)="exprot()">导出</button>
  </div>
</ng-template>

<nz-modal [(nzVisible)]="isVisibleRE" [nzWidth]="600" [nzFooter]="nzModalFooterview2" (nzOnOk)="handleOK()" nzTitle="处理"
  (nzOnCancel)="Cancel()">
  <ng-container *nzModalContent>
    <sf #sfView [schema]="schemaView" [ui]="uiView" [compact]="true" [button]="'none'">
    </sf>
  </ng-container>
  <ng-template #nzModalFooterview2>
    <button nz-button nzType="default" (click)="handleCancel('1')">拒绝</button>
    <button nz-button nzType="primary" (click)="handleOK()">通过</button>
    <button nz-button nzType="primary" (click)="handleCancel2()">强制取消</button>
  </ng-template>
</nz-modal>